package com.nciae.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.nciae.po.HousemasterSocre;
import com.nciae.dao.HousemasterSocreMapper;
import com.nciae.service.IHousemasterSocreService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Guoliyu
 * @since 2022-03-31
 */
@Service
public class HousemasterSocreServiceImpl extends ServiceImpl<HousemasterSocreMapper, HousemasterSocre> implements IHousemasterSocreService {


    @Override
    public void add(HousemasterSocre housemasterSocre) {
        baseMapper.insert(housemasterSocre);
    }

    @Override
    public List<HousemasterSocre> findByHousemasterId(Long id) {
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("housemaster_id", id);
        return baseMapper.selectList(wrapper);
    }

    @Override
    public List<HousemasterSocre> findByScoreId(Long id) {
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("score_id", id);
        return baseMapper.selectList(wrapper);
    }
}
